﻿SSVC.Wrap.Dojo.Require(["dijit/_WidgetBase", "dijit/_TemplatedMixin"],
	 SSVC.Wrap.Dojo.Hitch(this,
		function(_WidgetBase, _TemplatedMixin)
		{
			return SSVC.Wrap.Dojo.SetObject("SSVC.UI.TemplateControl", SSVC.Wrap.Dojo.Declare([_WidgetBase, _TemplatedMixin],
            {
            	ElementOnFocus: function(el, innerText)
            	{
            		var startValue = (el.type == "text") ? el.value.trim() : el.innerHTML.trim();

            		if (startValue == innerText)
            		{
            			if (el.type == "text")
            				el.value = "";
            			else
            				el.innerHTML = "";
            			el.style.color = "#000000";
            		}
            	},

            	ElementOnBlur: function(el, innerText)
            	{
            		var startValue = (el.type == "text") ? el.value.trim() : el.innerHTML.trim();
            		if (startValue === "")
            		{
            			if (el.type == "text")
            				el.value = innerText;
            			else
            				el.innerHTML = innerText;
            			el.style.color = "#758092";
            		}
            	},

            	HideElement: function(el)
            	{
            		el.style.display = "none";
            	},

            	ShowElement: function(el, displayStyle)
            	{
            		if (!displayStyle) displayStyle = "inline";
            		el.style.display = displayStyle;
            	}
            }));
		}));
